emacs.git
2 years ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 10 Feb 2024 10:09:30 +0000 (05:09 -0500)]
; Merge from origin/emacs-29

The following commit was skipped:

f1e7b5230ad Tramp: Handle PIN requests from security keys (don't merge)

2 years agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 10 Feb 2024 10:07:56 +0000 (05:07 -0500)]
Merge from origin/emacs-29

7d3a1444864 ; Mention defface's and their :version tags in CONTRIBUTE.
09c53b717d4 * admin/notes/kind-communication: New file.
31ca4e5501f ; And another fix of CONTRIBUTE.
d65499e7908 ; Another clarification in CONTRIBUTE.
571ec583d64 ; Clarify "ChangeLog entries" in CONTRIBUTE.
e2682316867 Don't skip links to "." and ".." in Dired when marking files
e25d11314d8 Pass unquoted filename to user-supplied MUSTMATCH predicate
47496993703 * doc/lispref/parsing.texi (Retrieving Nodes): Improve do...
d0673ea0d42 ; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug...

* lisp/emacs-lisp/trace.el:
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Remove
training whitespace.

2 years ago; * etc/NEWS: Announce support of 'lzip' compressed Info files (bug#69004).
Eli Zaretskii [Sat, 10 Feb 2024 09:22:01 +0000 (11:22 +0200)]
; * etc/NEWS: Announce support of 'lzip' compressed Info files (bug#69004).

2 years agoSupport Info files compressed by 'lzip'
Eli Zaretskii [Sat, 10 Feb 2024 09:20:22 +0000 (11:20 +0200)]
Support Info files compressed by 'lzip'

* lisp/info.el (Info-suffix-list): Support lzip compression of
Info files.  (Bug#69004)

2 years ago* lisp/bind-key.el (personal-keybindings): Autoload it (bug#68999).
Eli Zaretskii [Sat, 10 Feb 2024 09:10:08 +0000 (11:10 +0200)]
* lisp/bind-key.el (personal-keybindings): Autoload it (bug#68999).

2 years agoAvoid errors in winner.el's 'post-command-hook'
Eli Zaretskii [Sat, 10 Feb 2024 09:04:22 +0000 (11:04 +0200)]
Avoid errors in winner.el's 'post-command-hook'

* lisp/winner.el (winner-save-old-configurations): Don't save
configuration of dead frames.  (Bug#68977)

2 years agoFix warning in tramp-register-archive-autoload-file-name-handler
Michael Albinus [Sat, 10 Feb 2024 08:50:12 +0000 (09:50 +0100)]
Fix warning in tramp-register-archive-autoload-file-name-handler

* lisp/net/tramp-archive.el
(tramp-register-archive-autoload-file-name-handler): Do not use
read syntax #' for `tramp-archive-file-name-handler', it isn't
autoloaded.

2 years agoRun 'read-only-mode-hook' when visiting a file that is not writable
Eli Zaretskii [Sat, 10 Feb 2024 08:35:18 +0000 (10:35 +0200)]
Run 'read-only-mode-hook' when visiting a file that is not writable

* lisp/files.el (after-find-file): Run 'read-only-mode-hook'
when the visited file is not writable.  (Bug#68648)

2 years agoFix volume refresh bug in mpc
john muhl [Fri, 26 Jan 2024 03:23:45 +0000 (21:23 -0600)]
Fix volume refresh bug in mpc

* lisp/mpc.el (mpc-volume-refresh): Only refresh volume when mpd
is playing.  When stopped or paused, volume is nil.  (Bug#68785)

2 years ago; Improve documentation of a recent change in Gnus
Eli Zaretskii [Sat, 10 Feb 2024 07:28:11 +0000 (09:28 +0200)]
; Improve documentation of a recent change in Gnus

* lisp/image.el (find-image): Doc fix.
* lisp/gnus/gnus.el (gnus-mode-line-logo): Fix doc string and
:type texts.  Add :version.  (Bug#68985)

2 years agoMake miscellaneous improvements to the Android port
Po Lu [Sat, 10 Feb 2024 07:02:39 +0000 (15:02 +0800)]
Make miscellaneous improvements to the Android port

* java/org/gnu/emacs/EmacsActivity.java (onCreate): Deal with
omitted calls to onWindowFocusChanged after activity recreation.

* java/org/gnu/emacs/EmacsService.java (clearWindow, clearArea):
Delete redundant wrapper functions.
(getUsefulContentResolver, getContentResolverContext): Delete
functions.
(openContentUri, checkContentUri): Stop searching for an
activity content resolver, as that's actually not necessary.

* src/android.c (android_init_emacs_service)
(android_init_emacs_window, android_clear_window)
(android_clear_area): Adjust to match.

2 years agoAdd option gnus-mode-line-logo
Mekeor Melire [Wed, 7 Feb 2024 22:00:08 +0000 (23:00 +0100)]
Add option gnus-mode-line-logo

* lisp/gnus/gnus.el (gnus-mode-line-logo): New option specifying
whether and which logo will be displayed in the mode-line.
* etc/NEWS: Announce the change.

2 years agoAdd concept indices for some Eshell commands
Jim Porter [Thu, 8 Feb 2024 19:44:05 +0000 (11:44 -0800)]
Add concept indices for some Eshell commands

* doc/misc/eshell.texi (List of Built-ins): Add indices for some
directory- and process-related commands.
(Aliases): Change to concept index.

2 years agoIn Eshell manual, put command index anchors above the item
Jim Porter [Thu, 8 Feb 2024 19:31:17 +0000 (11:31 -0800)]
In Eshell manual, put command index anchors above the item

This makes sure that when navigating to the command's documentation from
the index, it shows the item heading (which lists the supported
arguments).

* doc/misc/eshell.texi (List of Built-ins, Tramp extensions)
(Extra built-in commands): Adjust placement of '@cmindex'.

2 years agoPut the list of built-in Eshell commands in its own manual node
Jim Porter [Thu, 8 Feb 2024 01:58:31 +0000 (17:58 -0800)]
Put the list of built-in Eshell commands in its own manual node

* doc/misc/eshell.texi (Built-ins): Fix capitalization of node to be
more consistent with the rest of the manual.  Fix a cross reference.
List child nodes.
(List of Built-ins): New section and node.
(Defining New Built-ins): Make this a node.  Fix capitalization.

2 years agomodula2.el: Avoid font-lock-*-face variables
Stefan Monnier [Fri, 9 Feb 2024 19:22:14 +0000 (14:22 -0500)]
modula2.el: Avoid font-lock-*-face variables

* lisp/progmodes/modula2.el (m3-font-lock-keywords-1)
(m3-font-lock-keywords-2): Refer to the font-lock faces directly

2 years ago* lisp/subr.el (with-output-to-temp-buffer): Add `indent` rule
Stefan Monnier [Fri, 9 Feb 2024 19:13:29 +0000 (14:13 -0500)]
* lisp/subr.el (with-output-to-temp-buffer): Add `indent` rule

2 years ago* lisp/subr.el (read-char-from-minibuffer): Fix bug#68995
Stefan Monnier [Fri, 9 Feb 2024 19:08:51 +0000 (14:08 -0500)]
* lisp/subr.el (read-char-from-minibuffer): Fix bug#68995

2 years agoTramp: Handle PIN requests from security keys
Michael Albinus [Fri, 9 Feb 2024 10:21:05 +0000 (11:21 +0100)]
Tramp: Handle PIN requests from security keys

* doc/misc/tramp.texi (Frequently Asked Questions): Clarify FIDO entry.

* lisp/net/tramp-sh.el (tramp-actions-before-shell)
(tramp-actions-copy-out-of-band):
Use `tramp-security-key-pin-regexp'.

* lisp/net/tramp.el (tramp-security-key-pin-regexp): New defcustom.
(tramp-action-otp-password, tramp-read-passwd): Trim password prompt.
(tramp-action-show-and-confirm-message): Expand for PIN requests.

2 years agoTramp: Handle PIN requests from security keys (don't merge)
Michael Albinus [Fri, 9 Feb 2024 10:05:14 +0000 (11:05 +0100)]
Tramp: Handle PIN requests from security keys (don't merge)

* doc/misc/tramp.texi (Frequently Asked Questions): Clarify FIDO entry.

* lisp/net/tramp-sh.el (tramp-actions-before-shell)
(tramp-actions-copy-out-of-band):
Use `tramp-security-key-pin-regexp'.

* lisp/net/tramp.el (tramp-security-key-pin-regexp): New defcustom.
(tramp-action-otp-password, tramp-read-passwd): Trim password prompt.
(tramp-action-show-and-confirm-message): Expand for PIN requests.

2 years agoPort to GNU Make 03ecd94488b85adc38746ec3e7c2a297a522598e
Paul Eggert [Fri, 9 Feb 2024 07:17:04 +0000 (23:17 -0800)]
Port to GNU Make 03ecd94488b85adc38746ec3e7c2a297a522598e

Problem reported by Collin Funk (Bug#68996).
* GNUmakefile (.): New macro.
(help): Use ‘$.’ instead of ‘$ ’.
* cross/verbose.mk.android, src/verbose.mk.in (.): New macro.
(AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD, AM_V_CXXLD, AM_V_GEN):
Use ‘$.’ instead of ‘$ ’.
* lib-src/Makefile.in (install): Use ‘$.’ instead of ‘$ ’.

2 years ago; Mention defface's and their :version tags in CONTRIBUTE.
Eli Zaretskii [Fri, 9 Feb 2024 06:49:55 +0000 (08:49 +0200)]
; Mention defface's and their :version tags in CONTRIBUTE.

2 years agoFix treesit_traverse_get_predicate (bug#68954)
Dominique Quatravaux [Thu, 8 Feb 2024 09:19:10 +0000 (10:19 +0100)]
Fix treesit_traverse_get_predicate (bug#68954)

Commit d005e685e1df7692085378633348db39a5190374 should have used
assq_no_signal, but didn't, this commit fixes that.

* src/treesit.c (treesit_traverse_get_predicate): Replace assq_no_quit
with assq_no_signal.

Copyright-paperwork-exempt: yes

2 years agoSet adstyle within sfnt font objects
Po Lu [Fri, 9 Feb 2024 05:15:57 +0000 (13:15 +0800)]
Set adstyle within sfnt font objects

* src/sfntfont.c (sfntfont_open): Don't incorrectly clear
desc->adstyle.

2 years agoDon't lose track of adstyles during face merging
Po Lu [Fri, 9 Feb 2024 02:43:48 +0000 (10:43 +0800)]
Don't lose track of adstyles during face merging

* src/xfaces.c (merge_face_vectors): If an adstyle exists in
FROM, guarantee that a font spec will exist in TO with the same.

2 years agoReplace a few calls to intern with constant strings
Po Lu [Fri, 9 Feb 2024 01:53:33 +0000 (09:53 +0800)]
Replace a few calls to intern with constant strings

* src/fns.c (do_yes_or_no_p, Fyes_or_no_p): Use symbol globals
rather than intern.
(syms_of_fns) <Qyes_or_no_p, Qy_or_n_p>: New symbols.

* src/lread.c (readevalloop): Use symbol global.
(syms_of_lread) <Qinternal_macroexpand_for_load>: New symbol.

2 years ago* admin/notes/kind-communication: New file.
Stefan Kangas [Thu, 8 Feb 2024 21:19:40 +0000 (22:19 +0100)]
* admin/notes/kind-communication: New file.

2 years ago; And another fix of CONTRIBUTE.
Eli Zaretskii [Thu, 8 Feb 2024 20:28:08 +0000 (22:28 +0200)]
; And another fix of CONTRIBUTE.

2 years ago; Another clarification in CONTRIBUTE.
Eli Zaretskii [Thu, 8 Feb 2024 19:26:36 +0000 (21:26 +0200)]
; Another clarification in CONTRIBUTE.

2 years ago; Clarify "ChangeLog entries" in CONTRIBUTE.
Eli Zaretskii [Thu, 8 Feb 2024 19:07:10 +0000 (21:07 +0200)]
; Clarify "ChangeLog entries" in CONTRIBUTE.

2 years agoRespect the delimiter of completer in Python shell completion
Liu Hui [Thu, 18 Jan 2024 04:00:00 +0000 (12:00 +0800)]
Respect the delimiter of completer in Python shell completion

* lisp/progmodes/python.el: (python-shell-completion-setup-code): Fix
the completion code of IPython.  Change the return value to JSON string
and ...
(python-shell-completion-get-completions): ... simplify parsing.
(inferior-python-mode): Update docstring.
(python-shell-readline-completer-delims): New variable indicating the
word delimiters of readline completer.
(python-shell-completion-native-setup): Set the completer delimiter.
(python-shell-completion-native-get-completions): Convert output string
to completions properly.
(python-shell--get-multiline-input)
(python-shell--extra-completion-context)
(python-shell-completion-extra-context): New functions.
(python-shell-completion-at-point): Send text beginning from the line
start if the completion backend does not need word splitting.  Remove
the detection of import statement because it is not needed anymore.
Create proper completion table based on completions returned from
different backends.

* test/lisp/progmodes/python-tests.el (python-tests--completion-module)
(python-tests--completion-parameters)
(python-tests--completion-extra-context): New helper functions.
(python-shell-completion-at-point-jedi-completer)
(python-shell-completion-at-point-ipython): New tests.  (bug#68559)

2 years agoFix 'browse-url-url-at-point' so that scheme does not duplicate
USAMI Kenta [Sat, 3 Feb 2024 18:20:24 +0000 (03:20 +0900)]
Fix 'browse-url-url-at-point' so that scheme does not duplicate

* lisp/net/browse-url.el (browse-url-url-at-point): Prepend
the default scheme only if no scheme present.  (Bug#68913)

2 years agoDon't skip links to "." and ".." in Dired when marking files
Eli Zaretskii [Thu, 8 Feb 2024 11:51:55 +0000 (13:51 +0200)]
Don't skip links to "." and ".." in Dired when marking files

* lisp/dired.el (dired-mark): Skip "." and "..", but not symlinks
to those two.  (Bug#38729)  (Bug#68814)

2 years ago; Ensure 'thing-at-point-looking-at' finds full match
Eshel Yaron [Wed, 31 Jan 2024 20:37:18 +0000 (21:37 +0100)]
; Ensure 'thing-at-point-looking-at' finds full match

* lisp/thingatpt.el (thing-at-point-looking-at): Regexp-search from
the beginning forward, instead of the other way around.

* test/lisp/thingatpt-tests.el (thing-at-point-test-data): Add tests.

(Bug#68762)

2 years ago`file-remote-p' must not return an error
Michael Albinus [Thu, 8 Feb 2024 10:17:22 +0000 (11:17 +0100)]
`file-remote-p' must not return an error

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler):
`file-remote-p' must not return an error.  (Bug#68976)

2 years ago; Improve documentation of 'echo-keystrokes-help'
Eli Zaretskii [Thu, 8 Feb 2024 06:56:42 +0000 (08:56 +0200)]
; Improve documentation of 'echo-keystrokes-help'

* doc/emacs/display.texi (Display Custom): Document
'echo-keystrokes-help'.

* etc/NEWS: Mark the 'echo-keystrokes-help' entry documented.

2 years ago; * src/keyboard.c (echo_dash): Mention F1 in echo_keystrokes_help.
Eli Zaretskii [Thu, 8 Feb 2024 06:48:20 +0000 (08:48 +0200)]
; * src/keyboard.c (echo_dash): Mention F1 in echo_keystrokes_help.

2 years ago* lisp/touch-screen.el (touch-screen): Fix defgroup version.
Po Lu [Thu, 8 Feb 2024 05:20:28 +0000 (13:20 +0800)]
* lisp/touch-screen.el (touch-screen): Fix defgroup version.

2 years agoPrevent echo area help message from being printed repeatedly
Po Lu [Thu, 8 Feb 2024 02:32:28 +0000 (10:32 +0800)]
Prevent echo area help message from being printed repeatedly

* src/keyboard.c (echo_dash): Detect echo_keystrokes_help
messages and return if they be present.

2 years agoFix earlier change to keyboard.c
Po Lu [Thu, 8 Feb 2024 02:01:57 +0000 (10:01 +0800)]
Fix earlier change to keyboard.c

* src/keyboard.c (echo_dash): Do not pass automatic string to
Lisp!
(syms_of_keyboard) <echo_keystrokes_help>: Improve doc string.

2 years agoPort better to Autoconf 2.72
Paul Eggert [Wed, 7 Feb 2024 21:17:57 +0000 (13:17 -0800)]
Port better to Autoconf 2.72

* configure.ac: Set ac_cv_type_gid_t=yes to pacify Autoconf 2.72
AC_TYPE_GETGROUPS.  Problem reported by Nick Bowler in:
https://lists.gnu.org/r/autoconf-patches/2024-02/msg00001.html

2 years agoMention 'C-h' in echo for unfinished commands
Dmitry Gutov [Wed, 7 Feb 2024 19:50:37 +0000 (21:50 +0200)]
Mention 'C-h' in echo for unfinished commands

* etc/NEWS: Mention it here.

* lisp/cus-start.el (standard): Add type and version for it.

* src/keyboard.c (echo-keystrokes-help): New user option
(https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00174.html).

* src/keyboard.c (echo_dash): Use it.

2 years agoImprove wording of message in buff-menu.el
Eli Zaretskii [Wed, 7 Feb 2024 17:14:20 +0000 (19:14 +0200)]
Improve wording of message in buff-menu.el

* lisp/buff-menu.el (Buffer-menu--selection-message): Improve
wording of selection messages.

2 years ago(file-notify--test-wait-event): Rename from `file-notify--test-read-event`
Stefan Monnier [Wed, 7 Feb 2024 16:20:46 +0000 (11:20 -0500)]
(file-notify--test-wait-event): Rename from `file-notify--test-read-event`

* test/lisp/filenotify-tests.el (file-notify--test-wait-event):
Rename to better reflect its purpose rather than
its implementation.  Also make it return nil so callers won't be
tempted to use the return value.

2 years agoPrefer \` and \' when matching the beg/end of string
Stefan Monnier [Wed, 7 Feb 2024 16:17:35 +0000 (11:17 -0500)]
Prefer \` and \' when matching the beg/end of string

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case)
(tramp-test01-file-name-syntax): Use more precise regexp

2 years ago* test/lisp/minibuffer-tests.el (completion-test--pcm-bug38458): New test
Stefan Monnier [Wed, 7 Feb 2024 16:15:59 +0000 (11:15 -0500)]
* test/lisp/minibuffer-tests.el (completion-test--pcm-bug38458): New test

2 years agoUse `defvar` for variables that are not constant
Stefan Monnier [Wed, 7 Feb 2024 16:13:56 +0000 (11:13 -0500)]
Use `defvar` for variables that are not constant

* test/lisp/international/mule-tests.el (sgml-html-meta-pre)
(sgml-html-meta-post):
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test-file-archive)
(tramp-archive-test-archive):
* test/lisp/emacs-lisp/macroexp-resources/vk.el (vk-b):
Don't use `defconst` if it's not constant.

2 years agoUse slot names rather than their :initargs
Stefan Monnier [Wed, 7 Feb 2024 16:11:38 +0000 (11:11 -0500)]
Use slot names rather than their :initargs

* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-39-clone-instance-inheritor-with-args):

* test/lisp/auth-source-tests.el (auth-source-ensure-ignored-backend)
(auth-source-backend-parse-macos-keychain)
(auth-source-backend-parse-macos-keychain-generic-string)
(auth-source-backend-parse-macos-keychain-internet-string)
(auth-source-backend-parse-macos-keychain-internet-symbol)
(auth-source-backend-parse-macos-keychain-generic-symbol)
(auth-source-backend-parse-macos-keychain-internet-default-string)
(auth-source-backend-parse-plstore, auth-source-backend-parse-netrc)
(auth-source-backend-parse-netrc-string)
(auth-source-backend-parse-secrets)
(auth-source-backend-parse-secrets-strings)
(auth-source-backend-parse-secrets-alias)
(auth-source-backend-parse-secrets-symbol)
(auth-source-backend-parse-secrets-no-alias):
Use slot names rather than their :initargs.

2 years ago; Fix last changes in buffer-menu.el and NEWS
Mattias Engdegård [Wed, 7 Feb 2024 13:35:44 +0000 (14:35 +0100)]
; Fix last changes in buffer-menu.el and NEWS

* etc/NEWS: Remove superfluous mention of key binding.
* lisp/buff-menu.el (Buffer-menu--selection-message): Go back to
previous wording.  It's not about what is hidden but what is shown;
the message is displayed in response to different actions.

2 years agoDon't compile lib/copy-file-range.c on MS-Windows
Eli Zaretskii [Wed, 7 Feb 2024 13:33:51 +0000 (15:33 +0200)]
Don't compile lib/copy-file-range.c on MS-Windows

* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_copy-file-range): Set to
true to avoid compiling copy-file-range.c on MS-Windows.  The
function 'copy_file_range' is not used on MS-Windows, while
compiling the file triggers warnings because lib/unistd.h, where
its prototype is declared, is omitted in the MS-Windows build.

2 years agoFix DEBUG_THREADS in the Android port
Po Lu [Wed, 7 Feb 2024 13:09:18 +0000 (21:09 +0800)]
Fix DEBUG_THREADS in the Android port

* java/org/gnu/emacs/EmacsService.java (EmacsService): New field
`mainThread'.
(onCreate): Set `mainThread' to the thread where the service's
looper executes.
(checkEmacsThread): Compare against SERVICE.mainThread.

2 years agoDeclare function properties in Tramp
Michael Albinus [Wed, 7 Feb 2024 12:19:27 +0000 (13:19 +0100)]
Declare function properties in Tramp

* lisp/net/tramp-message.el (tramp-backtrace, tramp-error)
(tramp-error-with-buffer, tramp-user-error):
Declare `tramp-suppress-trace' property.

2 years ago; .dir-locals.el (log-edit-mode) <fill-column>: Set to 64.
Po Lu [Wed, 7 Feb 2024 02:48:27 +0000 (10:48 +0800)]
; .dir-locals.el (log-edit-mode) <fill-column>: Set to 64.

2 years agoelixir-ts-mode: Highlight more method definitions
Wilhelm Kirschbaum [Wed, 7 Feb 2024 02:18:30 +0000 (04:18 +0200)]
elixir-ts-mode: Highlight more method definitions

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings):
Also highlight method definitions where the arguments are literal
values, not identifiers (bug#67246).

2 years agoelixir-ts-mode: Bring the faces' use closer to other ts modes
Dmitry Gutov [Wed, 7 Feb 2024 01:54:29 +0000 (03:54 +0200)]
elixir-ts-mode: Bring the faces' use closer to other ts modes

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings):
Rename feature 'elixir-function-name' to 'elixir-definition' and
update all deferences.  Add parameters' highlighting with
font-lock-variable-name-face.  Change variable references'
highlighting to use font-lock-variable-use-face.
Move the feature 'elixir-variable' from feature level 3 to level 4, to
match other ts modes (bug#67246).

2 years agoAdd access_call fontification to elixir-ts-mode
Wilhelm Kirschbaum [Fri, 29 Dec 2023 15:09:00 +0000 (17:09 +0200)]
Add access_call fontification to elixir-ts-mode

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--font-lock-settings):
Add access_call queries to the elixir-variable feature (bug#67246).

2 years ago; Fix typo in configure.ac
Po Lu [Wed, 7 Feb 2024 01:24:32 +0000 (09:24 +0800)]
; Fix typo in configure.ac

* configure.ac: Fix typo.  Reported by Juri Linkov
<juri@linkov.net>.

2 years agoPass unquoted filename to user-supplied MUSTMATCH predicate
Joseph Turner [Wed, 31 Jan 2024 06:08:50 +0000 (22:08 -0800)]
Pass unquoted filename to user-supplied MUSTMATCH predicate

* lisp/minibuffer.el (read-file-name-default): Pass REQUIRE-MATCH
argument through substitute-in-file-name.
* lisp/minibuffer.el (read-file-name): Update docstring.

Resolves bug#68815.

2 years ago(loaddefs-generate--compute-prefixes): Fix thinko in last change
Stefan Monnier [Tue, 6 Feb 2024 20:36:18 +0000 (15:36 -0500)]
(loaddefs-generate--compute-prefixes): Fix thinko in last change

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--compute-prefixes):
 Fix thinko in last change.  Also,       reduce memory allocation.

2 years ago; Fix last change in buffer-menu.el
Eli Zaretskii [Tue, 6 Feb 2024 19:55:57 +0000 (21:55 +0200)]
; Fix last change in buffer-menu.el

* etc/NEWS: Elaborate about the binding of the new command.

* lisp/buff-menu.el (Buffer-menu--selection-message): Fix wording
of new message.
(Buffer-menu-toggle-internal): Doc fix.  (Bug#68949)

2 years ago(loaddefs-generate--parse-file): Be a bit more defensive
Stefan Monnier [Tue, 6 Feb 2024 18:21:22 +0000 (13:21 -0500)]
(loaddefs-generate--parse-file): Be a bit more defensive

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Don't fail in case of an error while generating the prefixes.
(loaddefs-generate--compute-prefixes): Don't burp when
`read-from-string` returns something else than a symbol.

2 years agoUse new variable Buffer-menu-show-internal in project-list-buffers.
Juri Linkov [Tue, 6 Feb 2024 17:55:41 +0000 (19:55 +0200)]
Use new variable Buffer-menu-show-internal in project-list-buffers.

* lisp/progmodes/project.el (project-list-buffers): Add the new variable
`Buffer-menu-show-internal' used to toggle internal buffers (bug#68949).

2 years agoRearrange and pack hash table fields to reduce space
Mattias Engdegård [Tue, 6 Feb 2024 14:23:53 +0000 (15:23 +0100)]
Rearrange and pack hash table fields to reduce space

* src/lisp.h (struct Lisp_Hash_Table): Move and reduce width of fields
where possible; this saves an entire word at no apparent cost.

2 years agoChange hash range reduction from remainder to multiplication
Mattias Engdegård [Mon, 15 Jan 2024 08:25:02 +0000 (09:25 +0100)]
Change hash range reduction from remainder to multiplication

This makes both lookups and rehashing cheaper.  The index vector size
is now always a power of 2.  The first table size is reduced to
6 (from 8), because index vectors would become excessively big
otherwise.

* src/lisp.h (struct Lisp_Hash_Table): Replace index_size with
index_bits.  All references adapted.
(hash_table_index_size): New accessor; use it where applicable.
* src/fns.c (hash_index_size): Replace with...
(compute_hash_index_bits): ...this new function, returning the log2 of the
index size.  All callers adapted.
(hash_index_index): Knuth multiplicative hashing instead of remainder.
(maybe_resize_hash_table): Reduce first table size from 8 to 6.

2 years agoOptionally show internal buffers in Buffer Menu mode
Mattias Engdegård [Tue, 6 Feb 2024 11:39:11 +0000 (12:39 +0100)]
Optionally show internal buffers in Buffer Menu mode

Internal buffers were never shown before but they can be of interest
to Elisp developers, especially since there is no general mechanism to
remove unused buffers.

* lisp/buff-menu.el (Buffer-menu-show-internal)
(Buffer-menu--selection-message, Buffer-menu-toggle-internal): New.
(Buffer-menu-mode-map): Bind to `I`.
(Buffer-menu-mode-menu): Add menu entry.
(list-buffers--refresh): Extend filtering logic.
* etc/NEWS: Announce.

2 years agoImplement Lisp threading on Android
Po Lu [Tue, 6 Feb 2024 09:52:33 +0000 (17:52 +0800)]
Implement Lisp threading on Android

Much like the NS port, only the main thread receives input from
the user interface, which is fortunately not a major problem for
packages such as lsp-mode that create Lisp threads.

* configure.ac: Enable with_threads under Android.

* src/android.c (android_init_events): Set `main_thread_id' to
the ID of the main thread.
(setEmacsParams): Set new global variable `android_jvm' to the
JVM object, for the purpose of attaching Lisp threads to the
JVM.
(android_select): [THREADS_ENABLED]: If the caller isn't the
main thread, resort to pselect.  Don't check query before select
returns.
(android_check_query): Export.

* src/android.h (_ANDROID_H_): Define new macro and update
prototypes.

* src/process.c (android_select_wrapper): New function.
(wait_reading_process_output): If THREADS_ENABLED, call
thread_select through the Android select wrapper.

* src/thread.c (post_acquire_global_lock): Call
android_check_query; replace android_java_env with the incoming
Lisp thread's.
(run_thread): Attach and detach the thread created to the JVM.
(init_threads): Set the main thread's JNI environment object.

* src/thread.h (struct thread_state) <java_env>: New field.

2 years agoDon't forcibly display dialogs on Android if a keyboard is present
Po Lu [Tue, 6 Feb 2024 05:10:57 +0000 (13:10 +0800)]
Don't forcibly display dialogs on Android if a keyboard is present

* java/org/gnu/emacs/EmacsService.java (detectKeyboard): New
function.

* lisp/subr.el (use-dialog-box-p): Don't always return t if a
keyboard is present on Android.

* src/android.c (android_init_emacs_service): Link to new
function.
(android_detect_keyboard): New function.

* src/android.h: Update prototypes.

* src/androidfns.c (Fandroid_detect_keyboard)
(syms_of_androidfns): New function.

2 years agoUse treesit-node-match-p in treesit-parent-while
Yuan Fu [Tue, 6 Feb 2024 07:12:36 +0000 (23:12 -0800)]
Use treesit-node-match-p in treesit-parent-while

The previous commit should've done this, but I missed it.

* lisp/treesit.el (treesit-parent-while): Use treesit-node-match-p.

2 years agoPrefer `ITREE_FOREACH` over `overlays_in`
Stefan Monnier [Mon, 5 Feb 2024 22:58:47 +0000 (17:58 -0500)]
Prefer `ITREE_FOREACH` over `overlays_in`

Use `ITREE_FOREACH` instead of `overlays_in` if that can save us from
allocating an array.

* src/buffer.c (overlays_in): Mark as static.
(mouse_face_overlay_overlaps): Use `ITREE_FOREACH` instead of `overlays_in`.
(disable_line_numbers_overlay_at_eob): Same, and also change return
value to a boolean.
* src/buffer.h (overlays_in): Don't declare.
* src/editfns.c (overlays_around): Delete function.
(Fget_pos_property): Use `ITREE_FOREACH` and keep the "best so far"
instead of using `overlays_in` and sorting the elements.

* src/lisp.h (disable_line_numbers_overlay_at_eob): Change return
type to a boolean.
* src/xdisp.c (should_produce_line_number): Adjust accordingly.

2 years ago(gitmerge-mode-font-lock-keywords): Don't use font-lock-*-face vars
Stefan Monnier [Mon, 5 Feb 2024 19:50:45 +0000 (14:50 -0500)]
(gitmerge-mode-font-lock-keywords): Don't use font-lock-*-face vars

* admin/gitmerge.el (gitmerge-mode-font-lock-keywords): Refer to the
faces directly.

2 years agoGrudgingly accept function values in the function position
Mattias Engdegård [Mon, 5 Feb 2024 16:56:11 +0000 (17:56 +0100)]
Grudgingly accept function values in the function position

* lisp/emacs-lisp/cconv.el (cconv-convert):
Warn about (F ...) where F is a non-symbol function value (bytecode
object etc), but let it pass for compatibility's sake (bug#68931).
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--fun-value-as-head):
New test.

2 years ago(edebug-signal): Simplify
Stefan Monnier [Mon, 5 Feb 2024 15:13:56 +0000 (10:13 -0500)]
(edebug-signal): Simplify

Also, prefer #' to quote function names.

* lisp/emacs-lisp/edebug.el (edebug-signal): Instead of re-signaling
the error, let `signal_or_quit` continue processing it.

2 years ago; * etc/NEWS: Fix typos.
Michael Albinus [Mon, 5 Feb 2024 11:56:36 +0000 (12:56 +0100)]
; * etc/NEWS: Fix typos.

2 years ago* lisp/net/tramp.el (tramp-local-host-regexp): Adapt :version.
Michael Albinus [Mon, 5 Feb 2024 11:55:27 +0000 (12:55 +0100)]
* lisp/net/tramp.el (tramp-local-host-regexp): Adapt :version.

2 years agoAdapt cache handling in Tramp
Michael Albinus [Mon, 5 Feb 2024 11:54:56 +0000 (12:54 +0100)]
Adapt cache handling in Tramp

* lisp/net/tramp-cache.el (with-tramp-saved-file-property)
(with-tramp-saved-file-properties)
(with-tramp-saved-connection-property)
(with-tramp-saved-connection-properties): Do not change KEY
destructively.

2 years agoFix stale cache in Tramp
Michael Albinus [Mon, 5 Feb 2024 11:54:03 +0000 (12:54 +0100)]
Fix stale cache in Tramp

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Flush file properties in time.  (Bug#68805)

2 years agoFix frame focus tracking under Android
Po Lu [Mon, 5 Feb 2024 10:34:22 +0000 (18:34 +0800)]
Fix frame focus tracking under Android

* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus): New
argument WHENCE, a unique number identifying the circumstances
leading up to the call.  All callers changed.
(attachWindow): Call `invalidateFocus' from the UI thread.
(onWindowFocusChanged): Don't remove activity from
`focusedActivities' if it already exists should `hasWindowFocus'
return true.

2 years agoDon't respect ROUND_XY_TO_GRID when decomposing uninterpreted glyph
Po Lu [Mon, 5 Feb 2024 09:17:51 +0000 (17:17 +0800)]
Don't respect ROUND_XY_TO_GRID when decomposing uninterpreted glyph

* src/sfnt.c (sfnt_decompose_compound_glyph): Remove useless
code; don't pretend to round glyph coordinates.

2 years ago; Fix last change
Stefan Kangas [Mon, 5 Feb 2024 07:30:31 +0000 (08:30 +0100)]
; Fix last change

* lisp/filesets.el (filesets-quote): Resurrect as obsolete alias for
'shell-quote-argument'.

2 years agofilesets: Safely invoke `shell-command*' functions
Xi Lu [Thu, 23 Feb 2023 12:58:00 +0000 (20:58 +0800)]
filesets: Safely invoke `shell-command*' functions

* lisp/filesets.el:
(filesets-select-command, filesets-quote): Remove unused functions.
(filesets-external-viewers): Remove old comments.
(filesets-which-command, filesets-get-quoted-selection)
(filesets-spawn-external-viewer): Use `shell-quote-argument'.  (Bug#61709)

2 years agoDocument arguments to Eshell's built-in commands
Jim Porter [Wed, 16 Aug 2023 01:51:20 +0000 (18:51 -0700)]
Document arguments to Eshell's built-in commands

* lisp/eshell/em-unix.el (eshell/ln): LINK_NAME is required.

* lisp/eshell/esh-ext.el (eshell/addpath):
* lisp/eshell/esh-var.el (eshell/env): Improve help strings slightly.

* doc/misc/eshell.texi (Scripts): Explain $0, $1, etc.
(Dollars Expansion): Use "@dots{}" instead of "...".
(Built-ins, Tramp extensions, Extra built-in commands): Document
command-line arguments.

2 years agoUse treesit-node-match-p in treesit-parent-until/while
Yuan Fu [Mon, 5 Feb 2024 03:26:42 +0000 (19:26 -0800)]
Use treesit-node-match-p in treesit-parent-until/while

* lisp/treesit.el (treesit-parent-until): Use treesit-node-match-p.
(treesit-parent-while): Update docstring.
* doc/lispref/parsing.texi (Retrieving Nodes): Update docstring.

2 years agoImprove treesit-forward-sexp behavior for leaf nodes (bug#68899)
Yuan Fu [Sun, 4 Feb 2024 05:24:29 +0000 (21:24 -0800)]
Improve treesit-forward-sexp behavior for leaf nodes (bug#68899)

treesit-forward-sexp uses treesit--navigate-thing with 'restricted'
tactic.  In this tactic we don't move over the parent thing.  However,
this makes forward-sexp useless for symbols when point is in the
symbol rather than at the beginning of it: in that case, the symbol is
considered parent and treesit-forward-sexp won't move to the end of
it.

To solve that, we allow to move across the parent even in 'restricted'
mode if the parent is a leaf thing.

Here, "leaf thing" is defined as "doesn't have any child 'thing'
inside it".

* lisp/treesit.el (treesit--navigate-thing): Move over parent in
'restricted' tactic if the parent is a leaf thing.

2 years ago* lisp/emacs-lisp/comp.el (comp--native-compile): Use `error-message-string`
Stefan Monnier [Sun, 4 Feb 2024 19:39:02 +0000 (14:39 -0500)]
* lisp/emacs-lisp/comp.el (comp--native-compile): Use `error-message-string`

2 years ago* src/lread.c (bytecode_from_rev_list): Fix assertion failure
Stefan Monnier [Sun, 4 Feb 2024 18:51:13 +0000 (13:51 -0500)]
* src/lread.c (bytecode_from_rev_list): Fix assertion failure

The assertion failure was raised at lread.c:411 during the
`lread-invalid-bytecodes` test in `test/src/lread-tests.el`.
I suspect we could remove the assertion instead.

2 years ago* src/lread.c (build_load_history): Be careful with in-place updates
Stefan Monnier [Sun, 4 Feb 2024 17:58:56 +0000 (12:58 -0500)]
* src/lread.c (build_load_history): Be careful with in-place updates

Don't leave a "broken" value in `Vcurrent_load_list`.

2 years ago* src/window.c (set_window_buffer): Flush the `base_line_number` cache
Stefan Monnier [Sun, 4 Feb 2024 17:52:01 +0000 (12:52 -0500)]
* src/window.c (set_window_buffer): Flush the `base_line_number` cache

2 years ago(w->base_line_number): Rework the way we flush the cache
Stefan Monnier [Sun, 4 Feb 2024 17:50:55 +0000 (12:50 -0500)]
(w->base_line_number): Rework the way we flush the cache

* src/xdisp.c (BASE_LINE_NUMBER_VALID_P): New macro.
(try_scrolling): Use it.
(redisplay_window, Fformat_mode_line): Use it to flush the
base_line_number (if it's stale) once at the beginning.
(decode_mode_spec): Don't use (or set) `w->start` and
`w->base_line_number` when operating on another buffer!

2 years ago* doc/lispref/parsing.texi (Retrieving Nodes): Improve documentation.
Juri Linkov [Sun, 4 Feb 2024 17:22:21 +0000 (19:22 +0200)]
* doc/lispref/parsing.texi (Retrieving Nodes): Improve documentation.

Update optional arguments 'predicate' and 'include-node'
of 'treesit-node-top-level'.

2 years ago; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug#68914).
Eli Zaretskii [Sun, 4 Feb 2024 14:11:20 +0000 (16:11 +0200)]
; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug#68914).

2 years ago; Fix my last commit
Stefan Kangas [Sun, 4 Feb 2024 12:20:15 +0000 (13:20 +0100)]
; Fix my last commit

2 years agoPrefer setq-local in more places
Stefan Kangas [Sun, 4 Feb 2024 12:16:59 +0000 (13:16 +0100)]
Prefer setq-local in more places

* lisp/erc/erc-compat.el (erc-set-write-file-functions):
* lisp/obsolete/iswitchb.el (iswitchb-minibuffer-setup-hook)
(iswitchb-minibuffer-setup):
* lisp/obsolete/longlines.el (longlines-mode):
* lisp/obsolete/rcompile.el (remote-compile):
* lisp/progmodes/cperl-mode.el (cperl-file-style):
* test/lisp/erc/erc-tests.el (erc-ring-previous-command):
Prefer setq-local.

2 years agoPrevent cache of diff-mode buffers to grow without bounds
Mattias Engdegård [Sat, 3 Feb 2024 15:46:59 +0000 (16:46 +0100)]
Prevent cache of diff-mode buffers to grow without bounds

Previously, these " *diff-syntax:..." buffers were never removed.
Now we discard the least recently used half of them every hour.

* lisp/vc/diff-mode.el (diff--cached-revision-buffers)
(diff--cache-clean-interval, diff--cache-clean-timer, diff--cache-clean)
(diff--cache-schedule-clean, diff--get-revision-properties): New.
(diff-syntax-fontify-hunk): Use diff--get-revision-properties.

2 years ago* lisp/speedbar.el (imenu): Require unconditionally.
Stefan Kangas [Sun, 4 Feb 2024 10:26:43 +0000 (11:26 +0100)]
* lisp/speedbar.el (imenu): Require unconditionally.

2 years agoDelete compat code in `url` library
Stefan Kangas [Sun, 4 Feb 2024 09:28:40 +0000 (10:28 +0100)]
Delete compat code in `url` library

* lisp/url/url-cid.el (url-cid): Delete compat code for ancient Gnus.
* lisp/url/url-ldap.el (url-ldap-certificate-formatter): Delete compat
code; ssl.el has never been in Emacs.
* lisp/url/url-mailto.el (url-mail): Make into alias for 'message-mail',
since it is always fboundp.

2 years agoAdd alias progress-reporter-make
Stefan Kangas [Sun, 4 Feb 2024 09:28:18 +0000 (10:28 +0100)]
Add alias progress-reporter-make

* lisp/subr.el (progress-reporter-make): New alias for
'make-progress-reporter'.

2 years ago; Fix typos
Stefan Kangas [Sun, 4 Feb 2024 08:48:04 +0000 (09:48 +0100)]
; Fix typos

2 years agoFix display of invisible text with opposite directionality
Eli Zaretskii [Sun, 4 Feb 2024 09:45:15 +0000 (11:45 +0200)]
Fix display of invisible text with opposite directionality

* src/xdisp.c (handle_invisible_prop): Skip invisible text
correctly when it starts at position whose resolved bidi level is
above the base paragraph level.  (Bug#68446)

2 years agotramp: Tweak the ls-lisp declarations
Stefan Monnier [Sun, 4 Feb 2024 04:05:03 +0000 (23:05 -0500)]
tramp: Tweak the ls-lisp declarations

* lisp/net/tramp-sh.el (ls-lisp-use-insert-directory-program): Don't
declare its existence...
(tramp-sh-handle-insert-directory): ...test it instead.

* lisp/net/tramp.el (ls-lisp-dirs-first, ls-lisp-emulation)
(ls-lisp-ignore-case, ls-lisp-use-insert-directory-program)
(ls-lisp-verbosity): Move declaration...
(tramp-handle-insert-directory): ...to the point where we have a good
reason to think these variables exist.

2 years ago* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Add comment
Stefan Monnier [Sat, 3 Feb 2024 23:22:41 +0000 (18:22 -0500)]
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Add comment